package org.sbear.service;

import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.string.StringEncoder;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.sbear.handler.UserServiceHandler;
import org.sbear.pojo.RpcRequest;
import org.sbear.serivice.UserService;
import org.sbear.util.JSONSerializer;
import org.sbear.util.RpcDecoder;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;


/**
 * @author xxyWi
 */
@Service("UserService")
public class UserServiceImpl implements UserService {
    /**
     * 客户端远程要调用的方法
     *
     * @param msg
     * @return
     */
    @Override
    public String sayHello(String msg) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String date = format.format(new Date());
        System.out.println(date + "  调用成功--参数 " + msg);
        return date + "  success to receive:" + msg;
    }


}
